/**
 * 
 * led-panel.h - LED 点阵 (头文件)
 * by Nixsawe <ziming_cool@126.com>
 * 2021-12-16 ~ 2022-1-17
 * 
 * 为简化 LED 点阵的输出逻辑，封装此库
 * 
 * 适用于 8*8 大小的 led 点阵控制，借助 74HC595 芯片实现功能
 */

#ifndef __LED_PANEL_H__
#define __LED_PANEL_H__

#include<atmel/at89x52.h>
#include<string.h>
#include "s2p/74hc595.h"

#ifndef LED_PANEL_COL
// 定义 LED 点阵 K1~K8 对应的端口
// 列线
#define LED_PANEL_COL P0
#endif

// 暴露缓冲区数组
extern unsigned char led_panel_buffer[8];

void led_panel_write_map(unsigned char map[8][8]);
void led_panel_make_buffer(unsigned char map[8][8]);
void led_panel_print(unsigned char * buffer);
void led_panel_set_buffer(unsigned char * buffer);
void led_panel_clr_buffer();
void led_panel_write_col(unsigned char col);
void led_panel_set_col(unsigned char col_mask);
void led_panel_clr_col(unsigned char col_mask);
void led_panel_write_line(unsigned char line);
void led_panel_set_line(unsigned char line_mask);
void led_panel_clr_line(unsigned char line_mask);

#endif /* __LED_PANEL_H__ */

